<template>
  <div id="warncontentparent">
    <div class="title">
      <span class="time">时间</span>
      <span class="level">级别</span>
      <span class="adress">IP</span>
      <span class="content">告警内容</span>
    </div>
    <WarnContent :ContentData="ContentData" />
    <!-- <WarnContent :yearvalue="yearvalue"
                 :seriesdata="seriesdata"
                 :ipvalue="ipvalue"
                 :automatevalue="automatevalue" 
    /> -->
  </div>
</template>
<script>
import { getContent } from "../assets/api/twoapi";
import WarnContent from "./WarnContent";
export default {
  components: { WarnContent },
  data() {
    return {
      // seriesdata:['2020-1-6 19:37:04','严重','10.42.239.185','自动化运维系统，C的使用率当前值为99.0%，自动化运维系统，C的使用率。']
      ContentData: [],
      timer: null,
    };
  },
  mounted() {
    this.fetchData();
    this.timer = setInterval(() => {
      setTimeout(this.fetchData(), 0);
    }, 5000);
  },
  methods: {
    fetchData() {
      getContent().then((res) => {
        this.ContentData = res.data.result;
      });
    },
  },
  destroyed() {
    clearInterval(this.timer);
  },
};
</script>

<style scoped>
#warncontentparent {
  /* background: darkolivegreen; */
  height: 390px;
}
.title {
  /* background: darkmagenta; */
  width: 945px;
  height: 40px;
  line-height: 45px;
  color: #a4d6ff;
  font-size: 14px;
}
.time {
  margin-left: 70px;
}
.level {
  margin-left: 85px;
}
.adress {
  margin-left: 80px;
}
.content {
  margin-left: 275px;
}
</style>
